package com.dai.wechat.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class Result<T> {

    private String code;
    private T data;
    private String Message;


    public Result(String code, T data, String message) {
        this.code = code;
        this.data = data;
        Message = message;
    }

    public static Result suceessWithoutData(String message){
        return new Result("200",null,message);
    }

    public static <T>Result suceessWithData(T data){
        return new Result("200",data,"成功！");
    }

    public static Result failed(String code,String message){
        return new Result(code,null,message);
    }
}
